'use strict';

import mongoose from 'mongoose'
import Time from '../../methods/getTime'

const Schema = mongoose.Schema;

const articleSchema = new Schema({
      Article_title: String,
      Article_url: String,
      Article_sort: {type: Number, default: 0},
      Article_content: {type: String, default: ''},
      Article_type: String,
      Article_description: String,
      Article_imgUrl: {type: String, default: 'material-1.png'},
      Article_createOn: {type: String, default: Time},
      Article_preContent: String,
})

articleSchema.index({id: 1});

const typeSchema = new Schema({
      Types_name: String,
});

typeSchema.index({id: 1});

const Article = mongoose.model('Article', articleSchema);

const Types = mongoose.model('Types', typeSchema);

export {Article , Types}